package outils;

import java.util.Random;

import javax.media.j3d.Material;
import javax.vecmath.Color3f;

public class Materiaux {
	private final static Color3f ALU_DIFFUSE = new Color3f(0.37f, 0.37f, 0.37f);
	private final static Color3f ALU_REFLECHIT = new Color3f(0.89f, 0.89f,
			0.89f);
	public final static Material ALU = new Material(ALU_DIFFUSE, Couleurs.NOIR,
			ALU_DIFFUSE, ALU_REFLECHIT, 17);
	
	private final static Color3f ACIER_DIFFUSE = new Color3f(0.23f, 0.23f,
			0.23f);
	private final static Color3f ACIER_REFLECHIT = new Color3f(0.95f, 0.95f,
			0.95f);
	public final static Material ACIER = new Material(ACIER_DIFFUSE,
			Couleurs.NOIR, ACIER_DIFFUSE, ACIER_REFLECHIT, 17);

	private final static Color3f EBENE_DIFFUSE = new Color3f(0.1f, 0.1f, 0.1f);
	private final static Color3f EBENE_REFLECHIT = new Color3f(0.95f, 0.95f,
			0.95f);
	public final static Material EBENE = new Material(EBENE_DIFFUSE,
			Couleurs.NOIR, EBENE_DIFFUSE, EBENE_REFLECHIT, 17);
	
	private final static Color3f PLAS_ROUGE_DIFFUSE = Couleurs.ROUGE;
	private final static Color3f PLAS_ROUGE_REFLECHIT = new Color3f(0.95f,
			0.95f, 0.95f);
	public final static Material PLAS_ROUGE = new Material(PLAS_ROUGE_DIFFUSE,
			Couleurs.NOIR, PLAS_ROUGE_DIFFUSE, PLAS_ROUGE_REFLECHIT, 17);
	
	private final static Color3f PLAS_BLEU_DIFFUSE = Couleurs.BLEU;
	private final static Color3f PLAS_BLEU_REFLECHIT = new Color3f(0.95f,
			0.95f, 0.95f);
	public final static Material PLAS_BLEU = new Material(PLAS_BLEU_DIFFUSE,
			Couleurs.NOIR, PLAS_BLEU_DIFFUSE, PLAS_BLEU_REFLECHIT, 17);
	
	private final static Color3f LAQUE_BLANCHE_DIFFUSE = new Color3f(0.85f, 0.85f,
			0.85f);
	private final static Color3f LAQUE_BLANCHE_REFLECHIT = new Color3f(0.95f, 0.95f,
			0.95f);
	public final static Material LAQUE_BLANCHE = new Material(LAQUE_BLANCHE_DIFFUSE,
			Couleurs.NOIR, LAQUE_BLANCHE_DIFFUSE, LAQUE_BLANCHE_REFLECHIT, 17);
	
	static public Material matAlea() {
		Random r = new Random();
		Color3f DIFFUSE = new Color3f(r.nextFloat(), r.nextFloat(), r
				.nextFloat());
		Color3f REFLECHIT = new Color3f(r.nextFloat(), r.nextFloat(), r
				.nextFloat());
		return new Material(DIFFUSE, Couleurs.NOIR, DIFFUSE, REFLECHIT, 17);
	}

	static public Material matAleaR() {
		Random r = new Random();
		Color3f DIFFUSE = new Color3f(0.3f + 0.7f * r.nextFloat(), 0, 0);
		Color3f REFLECHIT = new Color3f(0.3f + 0.7f * r.nextFloat(), 0, 0);
		return new Material(DIFFUSE, Couleurs.NOIR, DIFFUSE, REFLECHIT, 17);
	}

	static public Material matAleaB() {
		Random r = new Random();
		Color3f DIFFUSE = new Color3f(0, 0, 0.3f + 0.7f * r.nextFloat());
		Color3f REFLECHIT = new Color3f(0, 0, 0.3f + 0.7f * r.nextFloat());
		return new Material(DIFFUSE, Couleurs.NOIR, DIFFUSE, REFLECHIT, 17);
	}
	
	static public Material matAleaJ() {
		Random r = new Random();
		float r1 = 0.5f + 0.5f * r.nextFloat();
		float r2 = 0.5f + 0.5f * r.nextFloat();
		Color3f DIFFUSE = new Color3f(r1, r1, 0);
		Color3f REFLECHIT = new Color3f(r2, r2, 0);
		return new Material(DIFFUSE, Couleurs.NOIR, DIFFUSE, REFLECHIT, 17);
	}
	
	static public Material matAleaV() {
		Random r = new Random();
		float r1 = 0.3f + 0.7f * r.nextFloat();
		float r2 = 0.7f + 0.3f * r.nextFloat();
		Color3f DIFFUSE = new Color3f(r1, 0, r1);
		Color3f REFLECHIT = new Color3f(r1, 0, r2);
		return new Material(DIFFUSE, Couleurs.NOIR, DIFFUSE, REFLECHIT, 17);
	}
}
